﻿#include "IndexController.h"
#include "LoginController.h"

IndexController::IndexController(){}

IndexController::~IndexController(){}

/**
 * 加载函数 一般做初始化UI和逻辑
 */
void IndexController::viewDidLoad(){
	CAView* view=this->getView();
	view->setColor(themeColor);
	CAImageView* imageView=CAImageView::createWithLayout(DLayoutFill);
	imageView->setImage(CAImage::create("img/index.png"));
	view->addSubview(imageView);
	//自动跳转到登录页
	CAScheduler::getScheduler()->scheduleOnce([=](float interval){
		IndexWindow::getInstance()->getRoot()->replaceViewController(LoginController::create(), true);
	}, "root_controller", view, 2);

}

/**
 * 卸载函数 一般做移除和释放
 */
void IndexController::viewDidUnload(){}